package ui.widget;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.Shape;
import java.awt.geom.RoundRectangle2D;

public class SearchBtn extends CommonStyleBtn {

	@Override
	protected void paintComponent(Graphics g) {
		Graphics2D g2d = (Graphics2D) g.create();
        int h = getHeight();
        int w = getWidth();
        g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
        g2d.setColor(Color.white);
        g2d.fillRect(0, 0, w, h);
        GradientPaint paint = new GradientPaint(0, 0, Color.CYAN, 0, h, Color.MAGENTA);
        g2d.setPaint(paint);
        BasicStroke bs = new BasicStroke(2);
        g2d.setStroke(bs);
        g2d.drawOval(8, 5, 15, 15);
        g2d.drawLine(21, 18, w - 8, h - 6);
        g2d.setColor(Color.BLACK);
        bs = new BasicStroke(1);
        g2d.setStroke(bs);
        int x1 = 0, y1 = 0, x2 = w - 1, y2 = 0, x3 = 0, y3 = h - 1, x4 = w - 1, y4 = h - 1;
        g2d.drawLine(x3, y3, x4, y4);
        g2d.drawLine(x1, y1, x2, y2);
        g2d.drawLine(x2, y2, x4, y4);

        g2d.dispose();
	}
}
